﻿namespace DataAccess.Entity
{
    public class BaseInfo
    {
        
    }

    public class TableInfo : BaseInfo
    {
        public string TableName { get; set; }
        /// <summary>
        /// 主键的名称
        /// </summary>
        public string PrimaryKeyName { get; set; }
    }

    public class ColumnInfo : BaseInfo
    {
        public string TableName { get; set; }
        public string ColumnName { get; set; }
        public string TypeName { get; set; }
        public string DataScale { get; set; }
        public string Length { get; set; }
        public int ColumnIndex { get; set; }
        public bool IsNull { get; set; }
        public string DefaultValue { get; set; }
        public bool IsPrimaryKey { get; set; }
        public bool IsForeignKey { get; set; }
    }

    public class IndexInfo : BaseInfo
    {
        public string TableName { get; set; }
        public string IndexName { get; set; }
        public string ColumnName { get; set; }
        public bool IsUnique { get; set; }
        public string Sequence { get; set; }
    }

    public class RelationshipInfo : BaseInfo
    {
        public string TableName { get; set; }
        /// <summary>
        /// 外键列
        /// </summary>
        public string ColumnName { get; set; }
        /// <summary>
        /// 关系表
        /// </summary>
        public string RelationTableName { get; set; }
        /// <summary>
        /// 关系列
        /// </summary>
        public string RelationColumnName { get; set; }
        /// <summary>
        /// 是否级联删除
        /// </summary>
        public bool IsCascadingDelete { get; set; }
        /// <summary>
        /// 是否级联更新
        /// </summary>
        public bool IsCascadingUpdate { get; set; }
        /// <summary>
        /// 外键名称
        /// </summary>
        public string RefKeyName { get; set; }
    }

    public class ViewInfo:BaseInfo
    {
        public string ViewName { get;set;}
        public string Content { get; set; }
    }

    public class ProcInfo : BaseInfo
    {
        public string ProcId { get; set; }
        public string ProcName { get; set; }
        public string Content { get; set; }
         public bool IsSystem { get; set; }        
    }

    public class ProcParamInfo:BaseInfo
    {
        public string ProcId { get; set; }
        public string ProcParamName { get; set; }
        public string TypeName { get; set; }
        public string Length { get; set; }
        public string State { get; set; }
        public int ParamIndex { get; set; }
        public string DataScale { get; set; }
       
    }

    public class TypeNameInfos
    {
        public string TypeName { get; set; }
        public int Length { get; set; }
        public int Scale { get; set; }
    }

}
